#!/bin/bash
#------------------------------
# Create a zip file that holds
# all the stuff for an applet
#------------------------------
DIST_DIR="./dist"
PLUGIN="$DIST_DIR/$1_plugin.zip"

# check for target directory
if [ ! -d "$DIST_DIR" ]; then
  mkdir $DIST_DIR
fi

# remove pyc files
find ./app/$1 -name "*.pyc" -exec rm '{}' \;

# zip up the applet
zip -r $PLUGIN app/$1/* html/$1/* web/$1/* > /dev/null

# done
echo Created Plugin $DIST_DIR/$1_plugin.zip
